package work.lrl.coupon_inventory;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.text.StrBuilder;
import com.alibaba.excel.EasyExcel;

import java.nio.charset.Charset;

import static work.lrl.coupon_inventory.Setting.*;

public class Demo {
    public static void main(String[] args) {
        StrBuilder sb = new StrBuilder();
        InventoryExcelReadListener listener = new InventoryExcelReadListener(
                (excelObject, analysisContext) -> {
                    sb.append(excelObject.getQuery());
                },
                analysisContext ->
                        FileUtil.writeString(sb.toString(), outPath, Charset.defaultCharset())
        );
        EasyExcel.read(dataPath, InventoryExcelObject.class, listener).sheet("Sheet1").doRead();
    }
}
